<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>登录中心-万科客户信息管理系统</title>
<script type="text/javascript">
function checkempty(){
	if(document.getElementById("username2").value=='' || document.getElementById("password2").value=='')
	{
		alert("请填写");
		return false;
	}
	//else{
	//	document.getElementById("loginform").submit();
	//	return true;
	//}
}

function show(){
	var nouser = ${result};
	var validate = ${validate};
	if(nouser == 1)
		alert("没有该用户");
	if(validate == 1){
		alert("密码错误，您还有2次机会输入");
	}
	else if(validate == 2){
		alert("密码错误，您还有1次机会输入");
	}
	else if(validate == 3){
		alert("您的账号已被冻结，请联系管理员为你解冻");
	}
	else if(validate == 4){
		alert("您已提交申请，请等待管理员批准");
	}
}
</script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}\view\theme\login.css"/>
</head>

<body onload="show()" id="body">
	<div id="login">
		<div id="vanke_img_part">
			<p><img src="${pageContext.request.contextPath}\image\wk.jpg" alt="万科" id="vanke_logo"/></p>
			<p><img src="${pageContext.request.contextPath}\image\snwk.jpg" alt="万科" id="vanke_info"/></p>
		</div>
		
		<div id="login_div_part">
			<p id="static_register">没有账号？<a href="<s:url value="/view/management/grandgf_register.jsp" />">注册新用户 </a></p>
			<hr>
			<p id="static_login">注册用户请直接登录</p>
			
			<s:form id="loginform" theme="simple" action="loginAction" method="post" onsubmit="return checkempty();">
			<table id="table_login">
				<tr class="table_login_row">
					<td class="table_login_static"><label for="username2">账    号：</label></td>
					<td class="table_login_input"><s:textfield id="username2" name="username" label="账号 "/></td>
				</tr>
				<tr class="table_login_row">
					<td class="table_login_static"><label for="password2">密    码：</label></td>			
					<td class="table_login_input"><s:password id="password2" name="password" label="密码 "/></td>
				</tr>
				<tr class="table_login_row">
					<td>  </td>
				</tr>
				<tr class="table_login_row">
					<td> </td>
					<td><s:submit value=" 登录 " id="button"/><a href="/view/forgetpass.jsp" id="static_forget">忘记密码？</a></td>
				</tr>
			</table>
			</s:form>
		</div>

		<div id="vanke_link_part">
			<hr>
			<a href="http://wuxi.vanke.com">@苏南万科主页</a>
		</div>
	</div>
	<div class="clear"></div>
</body>
</html>